const inquirer = require("inquirer");
const chalk = require("chalk");
const figlet = require("figlet");
const shell = require("shelljs");

const init = () => {
    console.log(
      chalk.green(
        figlet.textSync("Node JS CLI", {
          font: "Ghost",
          horizontalLayout: "default",
          verticalLayout: "default"
        })
      )
    );
  };
  

const run = async () => {
    // show script introduction
    init();
  
    const promptList = [{
        type: 'rawlist',
        message: '请选择项目医院:',
        name: 'project',
        choices: [
            {
                key: "1",
                name: "广西区妇幼",
                value: "qfy"
            },
            {
                key: "2",
                name: "桂林医学院",
                value: "gy"
            },
            {
                key: "3",
                name: "南宁市第二人民医院",
                value: "nan2"
            }
        ],
    }];
    return inquirer.default.prompt(promptList).then(answers => {
        console.log(answers); // 返回的结果
    });
  };

  run();